//
//  MyMapGrab.h
//  iPhoneKML
//
//  Created by Benjamin Blundell on 28/10/2009.
//  Copyright 2009 Section9. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <GData/GData.h>
#import "MyMapGrabDelegate.h"


// Class to grab and parse your own KML Files
// Returns copies of data to the views that need it
// Controlled by the master class to keep it single (aww)

@interface MyMapGrab : NSObject  {
	
	id<MyMapGrabDelegate>	delegate;
	
@private
	NSString				*username;
	NSString				*password;
	
	// tickets and google extras
	
	GDataServiceTicket		*mMapFeedTicket;
	NSError					*mMapFetchError;
	
	GDataFeedMap			*mMapFeed;
	GDataFeedMapFeature		*mMapDetailsFeed;
	NSInteger				lastMapGrabbed;
	NSInteger				numMapsToGrab;
	NSMutableDictionary		*mEntireMapFeed;
	
}

@property (nonatomic,retain) GDataFeedMap			*mMapFeed;
@property (nonatomic,retain) GDataFeedMapFeature	*mMapDetailsFeed;
@property (nonatomic,retain) GDataServiceTicket		*mMapFeedTicket;
@property (nonatomic,retain) NSError				*mMapFetchError;
@property (nonatomic,retain) NSString				*username;
@property (nonatomic,retain) NSString				*password;
@property (nonatomic,retain) id<MyMapGrabDelegate>	delegate;

@property (nonatomic,retain) NSMutableDictionary	*mEntireMapFeed;

- (void) fetchFeedOfMaps;
- (id) initWithUsername:(NSString*) user andPassword:(NSString*) pass;
- (void) fetchFeedOfPlacesWithMap:(NSInteger)mapindex;
- (void) fetchEntireFeed;
- (void) fetchAllPlacesWithMap:(GDataEntryMap*)map;

@end
